#定义403和404页面
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php

#
#定义无扩展名文件的默认解析类型
DefaultType text/html

#
#禁止对无索引文件的目录进行文件列表展示
Options -Indexes

#设置默认页
DirectoryIndex index.html index.php

#
# Gzip files 文件发送到浏览器之前先压缩
<IfModule mod_deflate.c>
# AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-javascript application/x-httpd-php image/jpeg application/x-bmp
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript application/rss+xml application/atom_xml text/javascript
AddOutputFilter DEFLATE html htm xml php js css jpg jpeg bmp
</IfModule>

<IfModule mod_security.c>
  SecFilterEngine Off
</IfModule>

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
# IE浏览器处理SSL的问题

<IfModule mod_setenvif.c>
  <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
  </IfDefine>
</IfModule>

#设置默认缓存时间
FileETag MTime Size
<ifModule mod_expires.c>
ExpiresActive On

ExpiresDefault "access plus 10 minutes"
ExpiresByType image/png "access plus 1 day"
ExpiresByType image/jpeg "access plus 1 day"
ExpiresByType video/mp4 "access plus 0 minutes"
ExpiresByType image/gif "access plus 1 day"
ExpiresByType image/x-icon "access plus 1 day"
ExpiresByType application/javascript "access plus 1 day"
ExpiresByType application/x-javascript "access plus 1 day"
ExpiresByType text/css "access plus 1 day"
</ifModule>

#设置在开启session的情况下也能缓存（实际是告诉apache不要自作主张发这些头出去）
<ifModule mod_headers.c>
#不发过期时间
#Header unset Expires
#Header unset Cache-Control
#Header unset Pragma
#设置默认的有效期
#Header set Cache-Control "private, max-age=100"
</ifModule>

#
# Fix certain PHP values 修改php配置的值
# (commented out by default to prevent errors occuring on certain
# servers)
#

# 关闭不安全的全局变量设置,如$a,$_POST['a'],$_GET['a'],$_SESSION['a']这几种变量是不一样的
php_value register_globals 0
# 关闭已经过时的$HTTP_*_VARS变量 
php_value register_long_arrays 0
php_value register_argc_argv 0

# 关闭或打开自动转义
php_value magic_quotes_gpc 0 

#AddDefaultCharset gb2312
#Options +FollowSymLinks
RewriteEngine on
RewriteBase /

#404页面的POST数据传递
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
# 增加识别JWT的认证参数
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0